package com.aimaoblog.admin.dao;

import com.aimaoblog.pojo.Article;
import com.aimaoblog.vo.ArticleAndCommentCountVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface ArticleMapper {
    int deleteByPrimaryKey(Integer id);

    int deleteByPrimaryKeyAsList(@Param("ids") List<Integer> ids);

    int insert(Article record);

    int insertSelective(Article record);

    Article selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Article record);

    int updateByPrimaryKey(Article record);

    List<ArticleAndCommentCountVo> selectAll();

    ArticleAndCommentCountVo selectById(Integer id);

    List<ArticleAndCommentCountVo> selectToLike(String keyWord);

    List<Article> selectAllByType(Integer type);

    List<ArticleAndCommentCountVo> selectByPrimaryKeyAsList(@Param("ids") List<Integer> ids);

    int cancelAllTop();

    List<ArticleAndCommentCountVo> selectAllBySort(Integer sortId);

    int updatePushDraftToNormal(@Param("ids") List<Integer> ids);
}